<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 值相等的最小索引 -->
    <script>
      var smallestEqual = function (nums) {
        const n = nums.length
        for (let i = 0; i < n; i++) {
          if (i % 10 === nums[i]) {
            return i
          }
        }
        return -1
      }
      console.log(smallestEqual([0, 1, 2]))
    </script>
  </body>
</html>
